/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ups.edu.ec.menu;

import java.util.ArrayList;
import java.util.List;
import org.hibernate.Session;
import ups.edu.ec.modelo.SpiModulo;
import ups.edu.ec.gestor.HibernateUtil;
/**
 *
 * @author bparedesb
 */
public class MenuAdm {
   // private List<SpiModulo>  modulo;
    private List<SpiModulo> modulo = new ArrayList<SpiModulo>();
    private SpiModulo moduloSel = null;
    

    public List<SpiModulo> listaModulos(){
        System.out.println("Consultar");
		Session	session = HibernateUtil.getSessionFactory().openSession();
		return session.createQuery("from SpiModulo").list();
        }

    public void seleccionarModulo(SpiModulo mod){
       System.out.println("Seleccion");
        if(mod != null)
        moduloSel = mod;
    }

    public List<SpiModulo> getModulo() {
        modulo = this.listaModulos();
        return modulo;
    }

    public void setModulo(List<SpiModulo> modulo) {
        this.modulo = modulo;
    }

    public SpiModulo getModuloSel() {
        return moduloSel;
    }

    public void setModuloSel(SpiModulo moduloSel) {
        this.moduloSel = moduloSel;
    }










}
